﻿using ClassLibrary;

namespace ConsoleDemo
{
    //显式类型转换
    internal class Conversion
    {
        //显式引用转换
        public static void ExplicitReferenceConversion()
        {
            ClassA myValA = new ClassA();
            ClassB myValB = (ClassB)myValA;  //编译通过，运行报错 InvalidCastException
        }
    }
}
